package cn.zn.modules.pz.his.service.impl;

import cn.zn.modules.pz.his.entity.PzBudget;
import cn.zn.modules.pz.his.entity.QPzBudget;
import cn.zn.modules.pz.his.repository.PzBudgetRepository;
import cn.zn.modules.pz.his.service.PzBudgetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class PzBudgetServiceImpl implements PzBudgetService {

    @Autowired
    private PzBudgetRepository pzBudgetRepository;

    @Override
    public List<PzBudget> findByMainId(Integer ap, String mainId) {
        QPzBudget qPzBudget = QPzBudget.pzBudget;
        return (List<PzBudget>) pzBudgetRepository.findAll(qPzBudget.ap.eq(ap).and(qPzBudget.mainId.eq(mainId)));
    }
}
